package net.yuyoo.uusession;

import javax.servlet.ServletRequest;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

public class UURequestWrapper extends javax.servlet.http.HttpServletRequestWrapper {

	private HttpSession s = null; 

	public UURequestWrapper(HttpSession s, HttpServletRequest req) {
		super(req);
		this.s = s;
		if (null == this.s) {
			throw new RuntimeException("无效 UUSession 引用");
		}
	}

	public HttpSession getSession(boolean create) {
		return this.s;
	}

	public HttpSession getSession() {
		return this.s;
	}

	@Override
	public ServletRequest getRequest() { 
		return this;
	}

	@Override
	public void setRequest(ServletRequest servletrequest) { 
		super.setRequest(servletrequest);
	} 
}
